package com.dong.vdbtc.validation.beanwrapper;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.PropertyValue;

/**
 * description
 *
 * @author Administrator 2021/09/08 9:16
 */
public class BeanWrapperTest {

    public static void main(String[] args) {
        BeanWrapper beanWrapper = new BeanWrapperImpl(new User());
        BeanWrapper beanWrapper1 = new BeanWrapperImpl(new Account());

        beanWrapper.setPropertyValue("name","zhangsan");

        beanWrapper1.setPropertyValue("username","jerry");

        PropertyValue value1 = new PropertyValue("password","123456");
        beanWrapper1.setPropertyValue(value1);

        beanWrapper.setPropertyValue("account",beanWrapper1.getWrappedInstance());

        System.out.println(beanWrapper.getWrappedInstance());
    }
}
